//
//  UIBarButtonItem+Extension.swift
//  HMWeibo
//
//  Created by wulei on 15/12/17.
//  Copyright © 2015年 wulei. All rights reserved.
//

import UIKit
extension UIBarButtonItem {
    convenience init(imageName: String, target: AnyObject?, action: String?) {
        
        let btn = UIButton(imageName: imageName, backImageName: nil)
        if let actionName = action {
            btn.addTarget(target, action: Selector(actionName), forControlEvents: .TouchUpInside)
        }
        
        self.init(customView:btn)
    }
}
